<template>
  <ul :class='classList'>
    <li v-for="item in getData">
      <router-link :to="item.url">
        <img :src="item.img" alt="">
        <p>{{item.label}}</p>
      </router-link>
    </li>
  </ul>
</template>
<script>
export default {
  props:["data","className"],
  components: {},
  name: "",
  data() {
    return {
      defaultData:[
        {
          img:require('../../assets/img/hpmepage/1.png'),
          label:"预约服务",
          url:"/appoints",
        },{
          img:require('../../assets/img/hpmepage/2.png'),
          label:"车辆续保",
          url:"/carsrenew",
        },{
          img:require('../../assets/img/hpmepage/3.png'),
          label:"顾问咨询",
          url:"/advisers",
        },{
          img:require('../../assets/img/hpmepage/4.png'),
          label:"新车专区",
          url:"/newuser",
        },{
          img:require('../../assets/img/hpmepage/5.png'),
          label:"养车知识",
          url:"/carsense",
        },{
          img:require('../../assets/img/hpmepage/6.png'),
          label:"优惠活动",
          url:"/discount",
        }
      ],
      classList:{
        'second-menu':true,
        'box-size':true
      }
    };
  },
  computed:{
    getData(){
      for(var key in this.className){
        this.classList[key]=this.className[key]
      }
      return this.data||this.defaultData
    }
  },
  methods: {
    
  },
  created() {}
};
</script>
<style lang="scss" scoped>
.second-menu {
  height: 200px;
  margin: 0 30px;
  border-radius:20px;
  background-color: #fff;
  z-index: 1;
  box-shadow:0px 0px 10px 2px rgba(243, 149, 25, 0.15);
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;


  li{
    width: calc(100% / 3);
    height: 50%;
    padding: 10px;
    text-align: center;
    box-sizing: border-box;

    a{
      display: inline-block;
      width: 100%;
      height: 100%;
      padding-top: 5px;
      font-size: 14px;
      color: #666;
    }
    
    img{
      width: 30px;
      height: 30px;
      margin: 0 auto;
    }
    p{
      margin-top: 12px;
    }
  }
  li:nth-child(1),li:nth-child(3),li:nth-child(2){
    border-bottom: 1px solid #F2F2F2;
  }
  li:nth-child(2),li:nth-child(5){
    border-left: 1px solid #F2F2F2;   
    border-right: 1px solid #F2F2F2;
  }
}

</style>